package com.gs.draw.controller;

import com.gs.common.core.domain.AjaxResult;
import com.gs.draw.feign.UserFeign;
import com.gs.gaosheng.domain.GsCouponUser;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
public class DrawController {
    @Resource
    private UserFeign userFeign;
    @GetMapping("/feign/userScore")
    public AjaxResult userScore(String userAccount) {
        Long score = userFeign.userScore(userAccount);
        return AjaxResult.success(score);
    }
    @PostMapping("/feign/updateUserScore")
    public AjaxResult updateUserScore(String userAccount,
                                      Long userScore) {
        userFeign.updateUserScore(userAccount,userScore);
        return AjaxResult.success("修改成功");
    }

    @PostMapping("/feign/add")
    public AjaxResult add(@RequestBody GsCouponUser gsCouponUser) {
        userFeign.add(gsCouponUser);
        return AjaxResult.success("添加成功");
    }

}
